//
//  SLFriendViewModel.m
//  StarLight
//
//  Created by Duke.wu on 16/6/1.
//  Copyright © 2016年 Duke.Wu. All rights reserved.
//

#import "SLFriendViewModel.h"
#import "SLNetWork.h"

@class SLFriendModel;
@implementation SLFriendViewModel




- (void)getBuddylist{
  @weakify(self)
  NSString *path = [NSString stringWithFormat:@"%@/user/buddylist?uid=%@",baseUrl, [DEFAULTS objectForKey:@"loginInformation"][@"id"]];
  
  [SLNetWork getDataWithRequest:path complete:^(id respond, NSError *error) {
    if (!error) {
      @strongify(self)
      self.friendList = [SLFriendModel mj_objectArrayWithKeyValuesArray:respond[@"data"]];
      
    }
  }];
}




@end




@implementation SLFriendModel

+ (NSDictionary *)mj_replacedKeyFromPropertyName{
  return @{@"fid":@"id"};
}

@end